<input type="hidden" id="ids" value="{$row.id}">
<div id="tab1" class="tab active">
    <div class="tab-labels">
        <div class="xian"></div>
        接报案录入
    </div>
    <div class="hang">
        <div class="form-group">
            <label class="control-label col-xs-12 col-sm-2">{:__('报案单号')}:</label>
            <div class="col-xs-12 col-sm-10">
                <input id="c-baoan_id" class="form-control" type="text" value="{$row.baoan_id}" readonly>
            </div>
        </div>
        <div class="form-group">
            <label class="control-label col-xs-12 col-sm-2">{:__('服务单号')}:</label>
            <div class="col-xs-12 col-sm-10">
                <input id="c-tong_number" class="form-control" type="text" value="{$row.tong_number}">
            </div>
        </div>
        <div class="form-group">
            <label class="control-label col-xs-12 col-sm-2">{:__('车牌号')}:</label>
            <div class="col-xs-12 col-sm-10">
                <input id="c-car_num" class="form-control" type="text" value="{$row.car_num}">
            </div>
        </div>
        <div class="form-group">
            <label class="control-label col-xs-12 col-sm-2">{:__('车架号')}:</label>
            <div class="col-xs-12 col-sm-10">
                <input id="c-car_vin" class="form-control" type="text" value="{$row.car_vin}">
            </div>
        </div>
    </div>
    <div class="hang">
        <div class="form-group">
            <label class="control-label col-xs-12 col-sm-2">{:__('被服务人')}:</label>
            <div class="col-xs-12 col-sm-10">
                <input id="c-learned_name" class="form-control" type="text" value="{$row.learned_name}">
            </div>
        </div>
        <div class="form-group">
            <label class="control-label col-xs-12 col-sm-2">{:__('被服务人手机')}:</label>
            <div class="col-xs-12 col-sm-10">
                <input id="c-learned_phone" class="form-control" type="text" value="{$row.learned_phone}">
            </div>
        </div>
        <div class="form-group">
            <label class="control-label col-xs-12 col-sm-2">{:__('核统日期')}:</label>
            <div class="col-xs-12 col-sm-10">
                <input id="c-yw_hetong_time" class="form-control" type="text"
                       value="{:date('Y-m-d', $row['yw_hetong_time'])}">
                <!--                            <input id="c-yw_hetong_time" class="form-control" name="row[yw_hetong_time]" type="text" value="{$row.yw_hetong_time}">-->
            </div>
        </div>
    </div>
    <div class="hang">
        <div class="form-group">
            <label class="control-label col-xs-12 col-sm-2">{:__('归属部门')}:</label>
            <div class="col-xs-12 col-sm-10">
                <input id="c-yw_class" class="form-control" type="text" value="{$row.yw_class_text}">
            </div>
        </div>
        <div class="form-group">
            <label class="control-label col-xs-12 col-sm-2">{:__('归属人')}:</label>
            <div class="col-xs-12 col-sm-10">
                <input id="c-yw_belonger" class="form-control" type="text" value="{$row.yw_belonger}">
            </div>
        </div>
        <div class="form-group">
            <label class="control-label col-xs-12 col-sm-2">{:__('服务起期')}:</label>
            <div class="col-xs-12 col-sm-10">
                <input id="c-plan_strattime" class="form-control" type="text"
                       value="{:date('Y-m-d', $row['plan_strattime'])}">
            </div>
        </div>
        <div class="form-group">
            <label class="control-label col-xs-12 col-sm-2">{:__('服务止期')}:</label>
            <div class="col-xs-12 col-sm-10">
                <input id="c-plan_endtime" class="form-control" " type="text" value="{:date('Y-m-d',
                $row['plan_endtime'])}">
            </div>
        </div>
    </div>
    <div class="hang">
        <div class="form-group">
            <label class="control-label col-xs-12 col-sm-2">{:__('报案人')}:</label>
            <div class="col-xs-12 col-sm-10">
                <input id="c-baoan_ren" class="form-control" type="text" value="{$row.baoan_ren}">
            </div>
        </div>
        <div class="form-group">
            <label class="control-label col-xs-12 col-sm-2">{:__('报案人电话')}:</label>
            <div class="col-xs-12 col-sm-10">
                <input id="c-baoan_phone" class="form-control" type="text" value="{$row.baoan_phone}">
            </div>
        </div>
        <div class="form-group">
            <label class="control-label col-xs-12 col-sm-2">{:__('报案时间')}:</label>
            <div class="col-xs-12 col-sm-10">
                <input id="c-baoan_time" class="form-control datetimepicker"
                       data-date-format="YYYY-MM-DD HH:mm:ss" data-use-current="true" type="text"
                       value="{$row['baoan_time'] ? date('Y-m-d H:i:s', $row['baoan_time']) : ''}">
            </div>
        </div>
    </div>
    <div class="hang">
        <div class="form-group">
            <label class="control-label col-xs-12 col-sm-2">{:__('出险时间')}:</label>
            <div class="col-xs-12 col-sm-10">
                <input id="c-chuxian_time" class="form-control datetimepicker"
                       data-date-format="YYYY-MM-DD HH:mm:ss" data-use-current="true" type="text"
                       value="{$row['chuxian_time'] ? date('Y-m-d H:i:s', $row['chuxian_time']) : ''}">
            </div>
        </div>
        <div class="form-group">
            <label class="control-label col-xs-12 col-sm-2">{:__('事故情况')}:</label>
            <div class="col-xs-12 col-sm-10">
                <input type="text" class="form-control" value="{$row.shigu_condition}">
            </div>
        </div>
        <div class="form-group">
            <label class="control-label col-xs-12 col-sm-2">{:__('是否有人伤')}:</label>
            <div class="col-xs-12 col-sm-10">
                <input type="text" class="form-control" value="{$row['is_renshang'] == 0 ? '否' : '是'}">
            </div>
        </div>
        <div class="form-group">
            <label class="control-label col-xs-12 col-sm-2">{:__('交强投保公司')}:</label>
            <div class="col-xs-12 col-sm-10">
                <input id="c-car_tbgs" class="form-control" type="text" value="{$row.car_tbgs}">
            </div>
        </div>
    </div>
    <div class="hang">
        <div class="form-group">
            <label class="control-label col-xs-12 col-sm-2">{:__('驾驶员')}:</label>
            <div class="col-xs-12 col-sm-10">
                <input id="c-car_ren" class="form-control" type="text" value="{$row.car_ren}">
            </div>
        </div>
        <div class="form-group">
            <label class="control-label col-xs-12 col-sm-2">{:__('驾驶员电话')}:</label>
            <div class="col-xs-12 col-sm-10">
                <input id="c-phone" class="form-control" type="text" value="{$row.phone}">
            </div>
        </div>
        <div class="form-group">
            <label class="control-label col-xs-12 col-sm-2">{:__('道路类型')}:</label>
            <div class="col-xs-12 col-sm-10">
                <input type="text" class="form-control" value="{$row.daolu_type}">
            </div>
        </div>
    </div>
    <div class="hang">
        <div class="form-group">
            <label class="control-label col-xs-12 col-sm-2">{:__('是否现场报案')}:</label>
            <div class="col-xs-12 col-sm-10">
                <input type="text" class="form-control" value="{$row.is_xcba == 0 ? '否' : '是'}">
            </div>
        </div>
        <div class="form-group">
            <label class="control-label col-xs-12 col-sm-2">{:__('是否联系交警')}:</label>
            <div class="col-xs-12 col-sm-10">
                <input type="text" class="form-control" value="{$row.is_lxjj == 0 ? '否' : '是'}">
            </div>
        </div>
    </div>
    <div class="hang">
        <div class="form-group">
            <label class="control-label col-xs-12 col-sm-2">{:__('出险地点')}:</label>
            <div class="col-xs-12 col-sm-10">
                <input id="c-address" class="form-control" type="text" value="{$row.address}">
            </div>
        </div>
        <div class="form-group">
            <label class="control-label col-xs-12 col-sm-2">{:__('查勘人')}:</label>
            <div class="col-xs-12 col-sm-10">
                <input class="form-control" type="text" value="{$row.chakan_ren}">
            </div>
        </div>
        <div class="form-group">
            <label class="control-label col-xs-12 col-sm-2">{:__('电话')}:</label>
            <div class="col-xs-12 col-sm-10">
                <input class="form-control" type="text" value="{$row.mobile}">
            </div>
        </div>
    </div>
    <div class="hang">
        <div class="form-group" style="width: 100%">
            <label class="control-label col-xs-12 col-sm-2">{:__('出险描述')}:</label>
            <div class="col-xs-12 col-sm-10">
                <textarea id="c-chuxian_describe" class="form-control" type="text" rows="5" value="" readonly>{$row.chuxian_describe}</textarea>
            </div>
        </div>
    </div>
    <div class="hang">
        <div class="form-group" style="width: 100%!important;">
            <label class="control-label col-xs-12 col-sm-2">{:__('备注')}:</label>
            <div class="col-xs-12 col-sm-10">
                <textarea class="form-control" type="text" rows="5" value="" readonly>{$row.beizhu}</textarea>
            </div>
        </div>
    </div>
</div>
<div id="tab2" class="tab">
    <form id="luru-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" action="">
        <input type="hidden" name="row[id]" value="{$row.id}">
        <div class="tab-labels">
            <div class="xian"></div>
            查勘录入
        </div>
        <div class="hang">
            <div class="form-group">
                <label class="control-label col-xs-12 col-sm-2">{:__('报案单号')}:</label>
                <div class="col-xs-12 col-sm-10">
                    <input id="c-baoan_id" class="form-control" name="row[baoan_id]" type="text"
                           value="{$row.baoan_id}" readonly>
                </div>
            </div>
            <div class="form-group">
                <label class="control-label col-xs-12 col-sm-2">{:__('报案时间')}:</label>
                <div class="col-xs-12 col-sm-10">
                    <input id="c-baoan_time" class="form-control datetimepicker" name="row[baoan_time]"
                           data-date-format="YYYY-MM-DD HH:mm:ss" data-use-current="true" type="text"
                           value="{$row['baoan_time'] ? date('Y-m-d H:i:s', $row['baoan_time']) : ''}">
                </div>
            </div>
            <div class="form-group">
                <label class="control-label col-xs-12 col-sm-2">{:__('车牌号')}:</label>
                <div class="col-xs-12 col-sm-10">
                    <input id="c-car_num" class="form-control" name="row[car_num]" type="text"
                           value="{$row.car_num}">
                </div>
            </div>
            <div class="form-group">
                <label class="control-label col-xs-12 col-sm-2">{:__('被服务人')}:</label>
                <div class="col-xs-12 col-sm-10">
                    <input id="c-learned_name" class="form-control" name="row[learned_name]" type="text"
                           value="{$row.learned_name}">
                </div>
            </div>
        </div>
        <div class="hang">
            <div class="form-group">
                <label class="control-label col-xs-12 col-sm-2">{:__('联系电话')}:</label>
                <div class="col-xs-12 col-sm-10">
                    <input id="c-phone" class="form-control" name="row[phone]" type="text" value="{$row.phone}">
                </div>
            </div>
            <div class="form-group">
                <label class="control-label col-xs-12 col-sm-2">{:__('驾驶员')}:</label>
                <div class="col-xs-12 col-sm-10">
                    <input id="c-car_ren" class="form-control" name="row[car_ren]" type="text"
                           value="{$row.car_ren}">
                </div>
            </div>
            <div class="form-group">
                <label class="control-label col-xs-12 col-sm-2">{:__('出险时间')}:</label>
                <div class="col-xs-12 col-sm-10">
                    <input id="c-chuxian_time" class="form-control datetimepicker"
                           data-date-format="YYYY-MM-DD HH:mm:ss" data-use-current="true" type="text"
                           name="row[chuxian_time]"
                           value="{$row['chuxian_time'] ? date('Y-m-d H:i:s', $row['chuxian_time']) : ''}">
                </div>
            </div>
            <div class="form-group">
                <label class="control-label col-xs-12 col-sm-2">{:__('实际驾驶员')}<span
                        style="color:red">*</span>:</label>
                <div class="col-xs-12 col-sm-10">
                    <input id="c-sj_car_ren" class="form-control" name="row[sj_car_ren]" type="text"
                           value="{$row.sj_car_ren}" data-rule="required">
                </div>
            </div>
        </div>
        <div class="hang">
            <div class="form-group">
                <label class="control-label col-xs-12 col-sm-2">{:__('性别')}:</label>
                <div class="col-xs-12 col-sm-10">
                    <select class="form-control" name="row[sex]">
                        <option value="">请选择性别</option>
                        <option value="男" {if condition="$row['sex'] eq '男'" }selected{else
                        /}''{/if}>男</option>
                        <option value="女" {if condition="$row['sex'] eq '女'" }selected{else
                        /}''{/if}>女</option>
                    </select>
                </div>
            </div>
            <div class="form-group">
                <label class="control-label col-xs-12 col-sm-2">{:__('驾驶证号')}<span
                        style="color:red">*</span>:</label>
                <div class="col-xs-12 col-sm-10">
                    <input id="c-car_card" class="form-control" name="row[car_card]" type="text"
                           value="{$row.car_card}" data-rule="required">
                </div>
            </div>
            <div class="form-group">
                <label class="control-label col-xs-12 col-sm-2">{:__('准驾车型')}<span
                        style="color:red">*</span>:</label>
                <div class="col-xs-12 col-sm-10">
                    <select class="form-control" name="row[car_zhunjia]" data-rule="required"
                            id="c-car_zhunjia">
                        <option value="">请选择准驾车型</option>
                        <?php foreach($site['zhunjia'] as $k => $v){?>
                        <option value="{$v}" {if condition="$row['car_zhunjia'] eq $v" }selected{else
                        /}''{/if}>{$v}</option>
                        <?php }?>
                    </select>
                </div>
            </div>
            <div class="form-group">
                <label class="control-label col-xs-12 col-sm-2">{:__('事故原因')}<span
                        style="color:red">*</span>:</label>
                <div class="col-xs-12 col-sm-10">
                    <select class="form-control" name="row[shigu_yuanyin]" data-rule="required"
                            id="c-shigu_yuanyin">
                        <option value="">请选择事故原因</option>
                        <?php foreach($site['shiguyuanyin'] as $k => $v){?>
                        <option value="{$v}" {if condition="$row['shigu_yuanyin'] eq $v" }selected{else
                        /}''{/if}>{$v}</option>
                        <?php }?>
                    </select>
                </div>
            </div>

        </div>
        <div class="hang">
            <div class="form-group">
                <label class="control-label col-xs-12 col-sm-2">{:__('预估责任')}<span
                        style="color:red">*</span>:</label>
                <div class="col-xs-12 col-sm-10">
                    <input id="c-shigu_zeren" class="form-control" name="row[shigu_zeren]" type="number"
                           value="{$row.shigu_zeren}" oninput='chuli_money()' data-rule="required">
                </div>
            </div>
            <div class="form-group">
                <label class="control-label col-xs-12 col-sm-2">{:__('事故整体预估金额')}<span
                        style="color:red">*</span>:</label>
                <div class="col-xs-12 col-sm-10">
                    <input id="c-liucheng" class="form-control" name="row[liucheng]" type="number"
                           value="{$row.liucheng}" oninput='chuli_money()' data-rule="required">
                </div>
            </div>
            <div class="form-group">
                <label class="control-label col-xs-12 col-sm-2">{:__('预估金额')}:</label>
                <div class="col-xs-12 col-sm-10">
                    <input id="c-yufu" class="form-control" name="row[yufu]" type="text" value="{$row.yufu}"
                           oninput='chuli_money()'>
                </div>
            </div>
        </div>
        <div class="hang">
            <div class="form-group">
                <label class="control-label col-xs-12 col-sm-2">{:__('事故处理部门')}<span
                        style="color:red">*</span>:</label>
                <div class="col-xs-12 col-sm-10">
                    <select class="form-control" name="row[shigu_group]" data-rule="required"
                            id="c-shigu_group">
                        <option value="">请选择事故处理部门</option>
                        <?php foreach($site['shigubumen'] as $k => $v){?>
                        <option value="{$v}" {if condition="$row['shigu_group'] eq $v" }selected{else
                        /}''{/if}>{$v}</option>
                        <?php }?>
                    </select>
                </div>
            </div>
            <div class="form-group">
                <label class="control-label col-xs-12 col-sm-2">{:__('道路类型')}:</label>
                <div class="col-xs-12 col-sm-10">
                    <select class="form-control" name="row[daolu_type]">
                        <option value="">请选择道路类型</option>
                        <?php foreach($site['daoluleixing'] as $k => $v){?>
                        <option value="{$v}" {if condition="$row['daolu_type'] eq $v" }selected{else
                        /}''{/if}>{$v}</option>
                        <?php }?>
                    </select>
                </div>
            </div>
        </div>
        <div class="hang">
            <div class="form-group">
                <label class="control-label col-xs-12 col-sm-2">{:__('事故类型')}<span
                        style="color:red">*</span>:</label>
                <div class="col-xs-12 col-sm-10">
                    <select class="form-control" name="row[shigu_type]" data-rule="required" id="c-shigu_type">
                        <option value="">请选择事故类型</option>
                        <?php foreach($site['shiguleixing'] as $k => $v){?>
                        <option value="{$v}" {if condition="$row['shigu_type'] eq $v" }selected{else
                        /}''{/if}>{$v}</option>
                        <?php }?>
                    </select>
                </div>
            </div>
            <div class="form-group">
                <label class="control-label col-xs-12 col-sm-2">{:__('重大案件')}<span
                        style="color:red">*</span>:</label>
                <div class="col-xs-12 col-sm-10">
                    <select class="form-control" name="row[zhongda_anjian]" data-rule="required"
                            id="c-zhongda_anjian">
                        <option value="">请选择是否为重大案件</option>
                        <option value="是" {if condition="$row['zhongda_anjian'] eq '是'" }selected{else
                        /}''{/if}>是</option>
                        <option value="否" {if condition="$row['zhongda_anjian'] eq '否'" }selected{else
                        /}''{/if}>否</option>
                    </select>
                </div>
            </div>
            <div class="form-group">
                <label class="control-label col-xs-12 col-sm-2">{:__('案件状态')}<span
                        style="color:red">*</span>:</label>
                <div class="col-xs-12 col-sm-10">
                    <select class="form-control" name="row[anjian_type]" data-rule="required"
                            id="c-anjian_type">
                        <option value="">请选择案件状态</option>
                        <?php foreach($site['anjianzhuangtai'] as $k => $v){?>
                        <option value="{$v}" {if condition="$row['anjian_type'] eq $v" }selected{else
                        /}''{/if}>{$v}</option>
                        <?php }?>
                    </select>
                </div>
            </div>
            <div class="form-group">
                <label class="control-label col-xs-12 col-sm-2">{:__('三责伤')}<span style="color:red">*</span>:</label>
                <div class="col-xs-12 col-sm-10">
                    <select class="form-control" name="row[sanze_shang]" data-rule="required"
                            id="c-sanze_shang">
                        <option value="">是否三责伤</option>
                        <option value="是" {if condition="$row['sanze_shang'] eq '是'" }selected{else
                        /}''{/if}>是</option>
                        <option value="否" {if condition="$row['sanze_shang'] eq '否'" }selected{else
                        /}''{/if}>否</option>
                    </select>
                </div>
            </div>
        </div>
        <div class="hang">
            <div class="form-group">
                <label class="control-label col-xs-12 col-sm-2">{:__('三者亡')}<span style="color:red">*</span>:</label>
                <div class="col-xs-12 col-sm-10">
                    <select class="form-control" name="row[sanzhe_wang]" data-rule="required"
                            id="c-sanzhe_wang">
                        <option value="">是否三者亡</option>
                        <option value="是" {if condition="$row['sanzhe_wang'] eq '是'" }selected{else
                        /}''{/if}>是</option>
                        <option value="否" {if condition="$row['sanzhe_wang'] eq '否'" }selected{else
                        /}''{/if}>否</option>
                    </select>
                </div>
            </div>
            <div class="form-group">
                <label class="control-label col-xs-12 col-sm-2">{:__('本车伤')}<span style="color:red">*</span>:</label>
                <div class="col-xs-12 col-sm-10">
                    <select class="form-control" name="row[benche_shang]" data-rule="required"
                            id="c-benche_shang">
                        <option value="">是否本车伤</option>
                        <option value="是" {if condition="$row['benche_shang'] eq '是'" }selected{else
                        /}''{/if}>是</option>
                        <option value="否" {if condition="$row['benche_shang'] eq '否'" }selected{else
                        /}''{/if}>否</option>
                    </select>
                </div>
            </div>
            <div class="form-group">
                <label class="control-label col-xs-12 col-sm-2">{:__('本车亡')}<span style="color:red">*</span>:</label>
                <div class="col-xs-12 col-sm-10">
                    <select class="form-control" name="row[benche_wang]" data-rule="required"
                            id="c-benche_wang">
                        <option value="">是否本车亡</option>
                        <option value="是" {if condition="$row['benche_wang'] eq '是'" }selected{else
                        /}''{/if}>是</option>
                        <option value="否" {if condition="$row['benche_wang'] eq '否'" }selected{else
                        /}''{/if}>否</option>
                    </select>
                </div>
            </div>
            <div class="form-group">
                <label class="control-label col-xs-12 col-sm-2">{:__('三者车辆数')}:</label>
                <div class="col-xs-12 col-sm-10">
                    <input id="c-sanzhe_che" class="form-control" name="row[sanzhe_che]" type="text"
                           value="{$row.sanzhe_che}">
                </div>
            </div>
        </div>
        <div class="hang">
            <div class="form-group">
                <label class="control-label col-xs-12 col-sm-2">{:__('是否施救')}<span
                        style="color:red">*</span>:</label>
                <div class="col-xs-12 col-sm-10">
                    <select class="form-control" name="row[is_shijiu]" data-rule="required" id="c-is_shijiu">
                        <option value="">请选择是否施救</option>
                        <option value="0" {if condition="$row['is_shijiu'] eq '0'" }selected{else
                        /}''{/if}>是</option>
                        <option value="1" {if condition="$row['is_shijiu'] eq '1'" }selected{else
                        /}''{/if}>否</option>
                    </select>
                </div>
            </div>
            <div class="form-group">
                <label class="control-label col-xs-12 col-sm-2">{:__('是否道路交通事故')}<span
                        style="color:red">*</span>:</label>
                <div class="col-xs-12 col-sm-10">
                    <select class="form-control" name="row[is_daoshigu]" data-rule="required"
                            id="c-is_daoshigu">
                        <option value="">请选择是否道路交通事故</option>
                        <option value="0" {if condition="$row['is_daoshigu'] eq '0'" }selected{else
                        /}''{/if}>是</option>
                        <option value="1" {if condition="$row['is_daoshigu'] eq '1'" }selected{else
                        /}''{/if}>否</option>
                    </select>
                </div>
            </div>
        </div>
        <div class="hang">
            <div class="form-group">
                <label class="control-label col-xs-12 col-sm-2">{:__('交管事故书')}<span
                        style="color:red">*</span>:</label>
                <div class="col-xs-12 col-sm-10">
                    <select class="form-control" name="row[shigubook]" data-rule="required" id="c-shigubook">
                        <option value="">请选择是否交管事故书</option>
                        <option value="0" {if condition="$row['shigubook'] eq '0'" }selected{else
                        /}''{/if}>是</option>
                        <option value="1" {if condition="$row['shigubook'] eq '1'" }selected{else
                        /}''{/if}>否</option>
                    </select>
                </div>
            </div>

            <div class="form-group">
                <label class="control-label col-xs-12 col-sm-2">{:__('事故书编号')}:</label>
                <div class="col-xs-12 col-sm-10">
                    <input id="c-shigubook_id" class="form-control" name="row[shigubook_id]" type="text"
                           value="{$row.shigubook_id}">
                </div>
            </div>
            <div class="form-group">
                <label class="control-label col-xs-12 col-sm-2">{:__('代位求偿')}<span
                        style="color:red">*</span>:</label>
                <div class="col-xs-12 col-sm-10">
                    <select class="form-control" name="row[daiwei]" data-rule="required">
                        <option value="">请选择是否代位求偿</option>
                        <option value="0" {if condition="$row['daiwei'] eq '0'" }selected{else
                        /}''{/if}>是</option>
                        <option value="1" {if condition="$row['daiwei'] eq '1'" }selected{else
                        /}''{/if}>否</option>
                    </select>
                </div>
            </div>
        </div>
        <div class="hang">
            <div class="form-group">
                <label class="control-label col-xs-12 col-sm-2">{:__('第一现场')}<span
                        style="color:red">*</span>:</label>
                <div class="col-xs-12 col-sm-10">
                    <select class="form-control" name="row[xianchang]" data-rule="required" id="c-xianchang">
                        <option value="">请选择是否为第一现场</option>
                        <option value="是" {if condition="$row['xianchang'] eq '是'" }selected{else
                        /}''{/if}>是</option>
                        <option value="否" {if condition="$row['xianchang'] eq '否'" }selected{else
                        /}''{/if}>否</option>
                    </select>
                </div>
            </div>
            <div class="form-group">
                <label class="control-label col-xs-12 col-sm-2">{:__('查勘机构')}:</label>
                <div class="col-xs-12 col-sm-10">
                    <input id="c-chakan_group" class="form-control" type="text"
                           value="{$row.chakan_group_name}">
                    <input id="c-chakan_group" class="form-control" name="row[chakan_group]" type="hidden"
                           value="{$row.chakan_group}">
                </div>
            </div>
            <div class="form-group">
                <label class="control-label col-xs-12 col-sm-2">{:__('查勘员')}:</label>
                <div class="col-xs-12 col-sm-10">
                    <input id="c-chakan_ren" class="form-control" name="row[chakan_ren]" type="text"
                           value="{$row.chakan_ren}">
                </div>
            </div>
            <div class="form-group">
                <label class="control-label col-xs-12 col-sm-2">{:__('电话')}:</label>
                <div class="col-xs-12 col-sm-10">
                    <input id="c-mobile" class="form-control" name="row[mobile]" type="text"
                           value="{$row.mobile}">
                </div>
            </div>
        </div>
        <div class="hang">
            <div class="form-group">
                <label class="control-label col-xs-12 col-sm-2">{:__('查勘时间')}<span
                        style="color:red">*</span>:</label>
                <div class="col-xs-12 col-sm-10">
                    <input id="c-chakan_time" class="form-control datetimepicker"
                           data-date-format="YYYY-MM-DD HH:mm:ss" data-use-current="true" type="text"
                           name="row[chakan_time]"
                           value="{$row['chakan_time'] ? date('Y-m-d H:i:s', $row['chakan_time']) : ''}"
                           data-rule="required">
                </div>
            </div>
            <div class="form-group">
                <label class="control-label col-xs-12 col-sm-2">{:__('查勘地点')}<span
                        style="color:red">*</span>:</label>
                <div class="col-xs-12 col-sm-10">
                    <select class="form-control" name="row[chakan_add]" data-rule="required" id="c-chakan_add">
                        <option value="">请选择查勘地点</option>
                        <?php foreach($site['chakandidian'] as $k => $v){?>
                        <option value="{$v}" {if condition="$row['chakan_add'] eq $v" }selected{else
                        /}''{/if}>{$v}</option>
                        <?php }?>
                    </select>
                </div>
            </div>
        </div>
        <div class="hang">
            <div class="form-group" style="width: 100%">
                <label class="control-label col-xs-12 col-sm-2">{:__('案件详细经过')}:</label>
                <div class="col-xs-12 col-sm-10">
                            <textarea id="c-anjian_jingguo" class="form-control" name="row[anjian_jingguo]" type="text"
                                      rows="5" value="">{$row.anjian_jingguo}</textarea>
                </div>
            </div>
        </div>
        <div class="hang">
            <div class="form-group" style="width: 100%!important;">
                <label class="control-label col-xs-12 col-sm-2">{:__('备注')}:</label>
                <div class="col-xs-12 col-sm-10">
                    <textarea class="form-control" name="row[anjian_beizhu]" type="text" rows="5" value="">{$row.anjian_beizhu}</textarea>
                </div>
            </div>
        </div>
        {if $row.status eq 0}
        <div class="form-group " style="margin-top: 50px;padding-bottom: 50px;">
            <label class="control-label col-xs-12 col-sm-2"></label>
            <div class="col-xs-12 " style="text-align: center;margin: auto;">
            </div>
        </div>
        {/if}
    </form>
</div>
<div id="tab3" class="tab">
    <form id="file-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" action="">
        <input type="hidden" id="class_id" name="category">
        <div class="tab-labels">
            <div class="xian"></div>
            影像上传
        </div>
        <div>
            <div class="form-group ">
                <label class="control-label col-xs-12 col-sm-2"></label>
                <div class="col-xs-12 " style="margin-left: 17%;">
                    <button  class="tab-label2 btn btn-primary btn-embossed" type="button" id="all_files" >显示全部</button>
                </div>
            </div>
        </div>
        <div>
            <div class="left" style="height: 500px;overflow-y: scroll;overflow-x: scroll;width: 15%;">
                <div class="form-group" style="margin-right: 0">
                    <div class="col-xs-12 col-sm-10">
                        <div id="treeview"></div>
                    </div>
                </div>
            </div>

            <div class="zhong" style="width: calc(85% - 40px);margin-left: 20px;">
                <div class="form-group">
                    <div class="col-xs-12">
                        <div class="input-group" style="display: block;">
                            <input type="hidden" name="row[files]" id="images">
                            <div class="input-group-addon no-border no-padding" style="width: 100%;position: relative">
                                <div style="position: absolute;left:0;top:0;width:100%;height:100%;opacity: 0" id="ss"></div>
                            </div>
                            <textarea id="c-files" class="form-control" name="row[files]" style="margin-top: 10px;display: none" rows="5">{$files}</textarea>
                            <span class="msg-box n-right"></span>
                        </div>
                        <ul class="row list-inline faupload-preview" id="p-files"></ul>
                    </div>
                </div>
            </div>
        </div>
    </form>
</div>
<div id="tab4" class="tab">
    <div class="top">
        <div class="tab-labels">
            <div class="xian"></div>
            车辆信息
        </div>
        <div class="left">
            <div class="form-group">
                <label class="control-label col-xs-12 col-sm-2">{:__('Plan_strattime')}:</label>
                <div class="col-xs-12 col-sm-10">
                    <input id="c-plan_strattime" class="form-control datetimepicker"
                           data-date-format="YYYY-MM-DD HH:mm:ss" data-use-current="true" type="text"
                           value="{:date('Y-m-d H:i:s', $res['plan_strattime'])}">
                </div>
            </div>
            <div class="form-group">
                <label class="control-label col-xs-12 col-sm-2">{:__('Yw_come')}:</label>
                <div class="col-xs-12 col-sm-10">
                    <input id="c-yw_come" class="form-control" type="text" value="{$res.yw_come}" readonly>
                </div>
            </div>
            <div class="form-group">
                <label class="control-label col-xs-12 col-sm-2">{:__('Car_num')}<span
                        style="color:red">*</span>:</label>
                <div class="col-xs-12 col-sm-10">
                    <input id="c-car_num" class="form-control" type="text" value="{$res.car_num}">
                </div>
            </div>
            <div class="form-group">
                <label class="control-label col-xs-12 col-sm-2">{:__('Car_register')}<span
                        style="color:red">*</span>:</label>
                <div class="col-xs-12 col-sm-10">
                    <input id="c-car_register" class="form-control" type="text" value="{$res.car_register}">
                </div>
            </div>
            <div class="form-group">
                <label class="control-label col-xs-12 col-sm-2">{:__('Car_use_nature')}<span
                        style="color:red">*</span>:</label>
                <div class="col-xs-12 col-sm-10">
                    <select id="c-car_use_nature" class="form-control">
                        <?php foreach($xingzhi as $k => $v){?>
                        <option value="{$v}"
                        <?php if($res['car_use_nature']== $v){?> selected<?php }?>>{$k}</option>
                        <?php }?>
                    </select>
                </div>
            </div>
            <div class="form-group">
                <label class="control-label col-xs-12 col-sm-2">{:__('Car_carry_peo')}<span
                        style="color:red">*</span>:</label>
                <div class="col-xs-12 col-sm-10">
                    <input id="c-car_carry_peo" class="form-control" type="number" value="{$res.car_carry_peo}">
                </div>
            </div>
            <div class="form-group">
                <label class="control-label col-xs-12 col-sm-2">{:__('Car_curb_weight')}:</label>
                <div class="col-xs-12 col-sm-10">
                    <input id="c-car_curb_weight" class="form-control" type="text"
                           value="{$res.car_curb_weight}">
                </div>
            </div>

        </div>
        <div class="zhong">
            <div class="form-group">
                <label class="control-label col-xs-12 col-sm-2">{:__('Plan_endtime')}:</label>
                <div class="col-xs-12 col-sm-10">
                    <input id="c-plan_endtime" class="form-control datetimepicker"
                           data-date-format="YYYY-MM-DD HH:mm:ss" data-use-current="true" type="text"
                           value="{:date('Y-m-d H:i:s', $res['plan_endtime'])}">
                </div>
            </div>

            <div class="form-group">
                <label class="control-label col-xs-12 col-sm-2">{:__('Yw_class')}:</label>
                <div class="col-xs-12 col-sm-10">
                    <input id="c-yw_class" class="form-control" type="text" value="{$res.yw_class_text}">
                    <input id="yw_class" class="form-control" type="hidden" value="{$res.yw_class}">
                </div>
            </div>
            <div class="form-group">
                <label class="control-label col-xs-12 col-sm-2">{:__('Car_vin')}<span
                        style="color:red">*</span>:</label>
                <div class="col-xs-12 col-sm-10">
                    <input id="c-car_vin" class="form-control" type="text" value="{$res.car_vin}">
                </div>
            </div>
            <div class="form-group">
                <label class="control-label col-xs-12 col-sm-2">{:__('Chexing')}<span
                        style="color:red">*</span>:</label>
                <div class="col-xs-12 col-sm-10">
                    <select id="c-chexing" class="form-control">
                        <?php foreach($chexing as $k => $v){?>
                        <option value="{$v}"
                        <?php if($res['chexing']== $v){?> selected<?php }?>>{$k}</option>
                        <?php }?>
                    </select>
                </div>
            </div>
            <div class="form-group">
                <label class="control-label col-xs-12 col-sm-2">{:__('Car_carry_quality')}<span
                        style="color:red">*</span>:</label>
                <div class="col-xs-12 col-sm-10">
                    <input id="c-car_carry_quality" class="form-control" type="text"
                           value="{$res.car_carry_quality}">
                </div>
            </div>
            <div class="form-group">
                <label class="control-label col-xs-12 col-sm-2">{:__('Car_reall')}:</label>
                <div class="col-xs-12 col-sm-10">
                    <input id="c-car_reall" class="form-control" type="text" value="{$res.car_reall}">
                </div>
            </div>
        </div>
        <div class="right">
            <div class="form-group" style="height: 62px;padding-top: 25px;">
                <label class="control-label col-xs-12"
                       style="width: 20%;text-align: left;padding-right: 0;">服务天数:</label>
                <div class="col-xs-12 col-sm-8" style="margin-top: 7px;padding-left: 0;" id="datecount">
                    365天
                </div>
            </div>
            <div class="form-group">
                <label class="control-label col-xs-12 col-sm-2">{:__('Yw_belonger')}:</label>
                <div class="col-xs-12 col-sm-10">
                    <input id="c-yw_belonger" class="form-control" type="text" value="{$res.yw_belonger}"
                           readonly>
                </div>
            </div>
            <div class="form-group">
                <label class="control-label col-xs-12 col-sm-2">{:__('Car_engine')}<span
                        style="color:red">*</span>:</label>
                <div class="col-xs-12 col-sm-10">
                    <input id="c-car_engine" class="form-control" type="text" value="{$res.car_engine}">
                </div>
            </div>
            <div class="form-group">
                <label class="control-label col-xs-12 col-sm-2">{:__('Chexing_ci')}:</label>
                <div class="col-xs-12 col-sm-10">
                    <input id="c-ncd" class="form-control" type="text" value="{$res.ncd}">
                </div>
            </div>
            <div class="form-group">
                <label class="control-label col-xs-12 col-sm-2">{:__('Car_buy')}:</label>
                <div class="col-xs-12 col-sm-10">
                    <input id="c-car_buy" class="form-control" type="text" value="{$res.car_buy}">
                </div>
            </div>
        </div>
        <div class="right">
            <div class="form-group" style="height: 62px;">
                <label class="control-label col-xs-12"
                       style="width: 20%;text-align: left;padding-right: 0;"></label>
                <div class="col-xs-12 col-sm-10" style="margin-top: 7px;padding-left: 0;">

                </div>
            </div>
            <div class="form-group" style="height: 62px;">
                <label class="control-label col-xs-12"
                       style="width: 20%;text-align: left;padding-right: 0;"></label>
                <div class="col-xs-12 col-sm-10" style="margin-top: 7px;padding-left: 0;">

                </div>
            </div>
            <div class="form-group">
                <label class="control-label col-xs-12 col-sm-2">{:__('Car_factory_num')}<span style="color:red">*</span>:</label>
                <div class="col-xs-12 col-sm-10">
                    <input id="c-car_factory_num" class="form-control" type="text"
                           value="{$res.car_factory_num}">
                </div>
            </div>
        </div>
    </div>
    <div class="xia">
        <div class="tab-labels">
            <div class="xian"></div>
            服务项目
        </div>
        <div class="form-group">
            <div class="col-xs-12">
                <table class="table fieldlist" data-template="basictpl" data-name="res[basic]" id="first-table">
                    <tr class="tcxm-td">
                        <!--                                <td><input type="checkbox" name="" id="checks"></td>-->
                        <td>{:__('主服务项目')}</td>
                        <td>{:__('服务金额')}</td>
                        <!--                                <td>{:__('不计免赔')}</td>-->
                        <td>{:__('标准服务费')}</td>
                        <td>{:__('折扣(%)')}</td>
                        <td>{:__('应缴服务费')}</td>
                    </tr>
                    <!--                            机动车损失服务-->
                    <tr class="form-inline">
                        <!--                                <td style="text-align: center">-->
                        <!--                                    <input type="checkbox" name="res[main_name]" id="main_name" value="1" class="chk" <?= $res['main_name'] ==1? ' checked="checked"' : '';?>>-->
                        <!--                                </td>-->
                        <td>机动车损失服务</td>
                        <td><input type="text" id="main_money" class="form-control" size="15"
                                   value="{$res.main_money}" placeholder="" readonly/></td>
                        <!--                                <td style="text-align: center">-->
                        <!--                                    <input type="checkbox" value="{$res.main_franchise}" name="res[main_franchise]" id="main_franchise">-->
                        <!--                                </td>-->
                        <td><input type="text" id="main_standard" class="form-control zongshu"
                                   value="{$res.main_standard}" readonly/></td>
                        <td><input type="text" id="sun" class="form-control" value="{$res.main_discount}"
                                   readonly/></td>
                        <td><input type="text" id="main_submit" class="form-control zong_tongchou"
                                   value="{$res.main_submit}" readonly/></td>
                    </tr>
                    <!--                            机动车损失服务-->
                    <tr class="form-inline">
                        <!--                                <td style="text-align: center">-->
                        <!--                                    <input type="checkbox" name="res[main_disan]" id="main_disan" value="1" class="chk" <?= $res['main_disan'] ==1? ' checked="checked"' : '';?>>-->
                        <!--                                </td>-->
                        <td>机动车第三者责任服务</td>
                        <td>
                            <select id="main_santong" class="form-control" style="width: 100%">
                                <option value="">请选择</option>
                                <option value="3000000"
                                <?php if($res['main_santong']=="3000000"){?> selected<?php }?>>300万</option>
                                <option value="2000000"
                                <?php if($res['main_santong']=="2000000"){?> selected<?php }?>>200万</option>
                                <option value="1500000"
                                <?php if($res['main_santong']=="1500000"){?> selected<?php }?>>150万</option>
                                <option value="1000000"
                                <?php if($res['main_santong']=="1000000"){?> selected<?php }?>>100万</option>
                                <option value="500000"
                                <?php if($res['main_santong']=="500000"){?> selected<?php }?>>50万</option>
                            </select>
                        </td>
                        <!--                                <td style="text-align: center">-->
                        <!--                                    <input type="checkbox" value="{$res.main_ji}" name="res[main_ji]" id="main_ji" />-->
                        <!--                                </td>-->
                        <td><input type="text" id="main_biao" class="form-control zongshu"
                                   value="{$res.main_biao}"/></td>
                        <td><input type="text" id="san" class="form-control" value="{$res.main_zhe}" readonly/>
                        </td>
                        <td><input type="text" id="main_yingjiao" class="form-control zong_tongchou"
                                   value="{$res.main_yingjiao}" readonly/></td>
                    </tr>
                    <!--                            机动车损失服务-->
                    <tr class="form-inline">
                        <!--                                <td style="text-align: center">-->
                        <!--                                    <input type="checkbox" name="res[siji]" id="si_jis" value="1" class="chk" <?= $res['siji'] ==1? ' checked="checked"' : '';?>>-->
                        <!--                                </td>-->
                        <td>车上人员责任服务(司机)<input type="text" class="form-control" value="1"
                                                         style="text-align: center" disabled/></td>
                        <td>
                            <select id="siji_tong" style="width: 100%" class="form-control">
                                <option value="">请选择</option>
                                <option value="10000"
                                <?php if($res['siji_tong']=="10000"){?> selected<?php }?>>1万</option>
                                <option value="20000"
                                <?php if($res['siji_tong']=="20000"){?> selected<?php }?>>2万</option>
                                <option value="30000"
                                <?php if($res['siji_tong']=="30000"){?> selected<?php }?>>3万</option>
                                <option value="40000"
                                <?php if($res['siji_tong']=="40000"){?> selected<?php }?>>4万</option>
                                <option value="50000"
                                <?php if($res['siji_tong']=="50000"){?> selected<?php }?>>5万</option>
                                <option value="100000"
                                <?php if($res['siji_tong']=="100000"){?> selected<?php }?>>10万</option>
                                <option value="200000"
                                <?php if($res['siji_tong']=="200000"){?> selected<?php }?>>20万</option>
                            </select>
                        </td>
                        <!--                                <td style="text-align: center">-->
                        <!--                                    <input type="checkbox" value="{$res.siji_ji}" name="res[siji_ji]" id="siji_ji" />-->
                        <!--                                </td>-->
                        <td><input type="text" id="siji_biao" class="form-control zongshu"
                                   value="{$res.siji_biao}"/></td>
                        <td><input type="text" id="siji" class="form-control" value="{$res.siji_zhe}" readonly/>
                        </td>
                        <td><input type="text" id="siji_ying" class="form-control zong_tongchou"
                                   value="{$res.siji_ying}" readonly/></td>
                    </tr>
                    <!--                            机动车损失服务-->
                    <tr class="form-inline">
                        <!--                                <td style="text-align: center">-->
                        <!--                                    <input type="checkbox" name="res[chengke]" id="chengkess" value="1" class="chk" <?= $res['chengke'] ==1? ' checked="checked"' : '';?>>-->
                        <!--                                </td>-->
                        <td>车上人员责任服务(乘客)<input type="text" id="zuo" class="form-control" size="15"
                                                         value="{$res.chengke_zuo}" style="text-align: center"
                                                         readonly/>座
                        </td>
                        <td>
                            <input type="hidden" id="ck_tong" value="{$res.ck_tong}" readonly="readonly"
                                   style="width: 100%;height: 100%;border: none;margin: 0;">
                            <select id="ck" style="width:100%;" class="form-control">
                                <option value="">请选择</option>
                                <option value="10000"
                                <?php if($res['ck_money']=="10000"){?> selected<?php }?>>1万</option>
                                <option value="20000"
                                <?php if($res['ck_money']=="20000"){?> selected<?php }?>>2万</option>
                                <option value="30000"
                                <?php if($res['ck_money']=="30000"){?> selected<?php }?>>3万</option>
                                <option value="40000"
                                <?php if($res['ck_money']=="40000"){?> selected<?php }?>>4万</option>
                                <option value="50000"
                                <?php if($res['ck_money']=="50000"){?> selected<?php }?>>5万</option>
                                <option value="100000"
                                <?php if($res['ck_money']=="100000"){?> selected<?php }?>>10万</option>
                                <option value="200000"
                                <?php if($res['ck_money']=="200000"){?> selected<?php }?>>20万</option>
                            </select>
                        </td>
                        <!--                                <td style="text-align: center">-->
                        <!--                                    <input type="checkbox" name="res[ck_ji]" id="ck_ji" value="{$res.ck_ji}" />-->
                        <!--                                </td>-->
                        <td><input type="text" id="ck_biao" class="form-control zongshu"
                                   value="{$res.ck_biao}"/></td>
                        <td><input type="text" id="cheng" class="form-control" value="{$res.ck_zhe}" readonly/>
                        </td>
                        <td><input type="text" id="ck_ying" class="form-control zong_tongchou"
                                   value="{$res.ck_ying}" readonly/></td>
                    </tr>
                    <tr class="tcxm-td">
                        <!--                                <td>	<input type="checkbox" lay-filter="checkall" name="" id="checkss"></td>-->
                        <td>{:__('附加服务项目')}</td>
                        <td>{:__('服务金额')}</td>
                        <!--                                <td>{:__('不计免赔')}</td>-->
                        <td>{:__('标准服务费')}</td>
                        <td>{:__('折扣(%)')}</td>
                        <td>{:__('应缴服务费')}</td>
                    </tr>
                    <!--                            机动车损失服务-->
                    <tr class="form-inline">
                        <!--                                <td style="text-align: center">-->
                        <!--                                    <input type="checkbox" name="res[dao_name]" id="dao_name" value="1" class="chks" <?= $res['dao_name'] ==1? ' checked="checked"' : '';?>>-->
                        <!--                                </td>-->
                        <td>三者医保外用药</td>
                        <td>
                            <select id="dao_tong" class="form-control" style="width: 100%">
                                <option value="">请选择</option>
                                <option value="50000"
                                <?php if($res['dao_tong']=="50000"){?> selected<?php }?>>5万</option>
                                <option value="100000"
                                <?php if($res['dao_tong']=="100000"){?> selected<?php }?>>10万</option>
                            </select>
                        </td>
                        <!--                                <td style="text-align: center">-->
                        <!--                                    <input type="checkbox" value="{$res.dao_ji}" name="res[dao_ji]" id="dao_ji" />-->
                        <!--                                </td>-->
                        <td><input type="text" id="dao_biao" class="form-control zongshu"
                                   value="{$res.dao_biao}" readonly/></td>
                        <td><input type="text" id="dao" class="form-control" value="100" readonly/></td>
                        <td><input type="text" id="dao_ying" class="form-control zong_tongchou"
                                   value="{$res.dao_ying}" readonly/></td>
                    </tr>
                    <tr class="form-inline">
                        <!--                                <td style="text-align: center">-->
                        <!--                                    <input type="checkbox" name="res[dianwang]" value="1" id="dianwangs" class="chks" <?= $res['dianwang'] ==1? ' checked="checked"' : '';?>>-->
                        <!--                                </td>-->
                        <td>附加外部电网故障损失险</td>
                        <td><input type="text" n id="dw_tong" class="form-control" size="15"
                                   value="{$res.dw_tong}" placeholder="" readonly/></td>
                        <!--                                <td style="text-align: center">-->
                        <!--                                    <input type="checkbox" name="res[dw_ji]" id="dw_ji" value="{$res.dw_ji}" />-->
                        <!--                                </td>-->
                        <td><input type="text" id="dw_biao" class="form-control zongshu" value="{$res.dw_biao}"
                                   readonly/></td>
                        <td><input type="text" id="dw" class="form-control" value="100" readonly/></td>
                        <td><input type="text" id="dw_ying" class="form-control zong_tongchou"
                                   value="{$res.dw_ying}" readonly/></td>
                    </tr>
                </table>
            </div>
        </div>
        <div class="form-group" style="margin-left: 0;">
            <div class="right">
                <div class="form-group">
                    <label class="control-label col-xs-12 col-sm-2">{:__('标准服务费（合计）')}:</label>
                    <div class="col-xs-12 col-sm-10">
                        <input type="text" class="form-control" placeholder="请输入标准服务费（合计）"
                               id="main_sum" oninput="vs()" onpropertychange="vs()" value="{$res.main_sum}"
                               readonly="readonly">
                    </div>
                </div>
            </div>

            <div class="right">
                <div class="form-group">
                    <label class="control-label col-xs-12 col-sm-2">{:__('折扣')}:</label>
                    <div class="col-xs-12 col-sm-10">
                        <input type="text" class="form-control" id="addz" value="{$res.main_sumdiscount}"/>
                    </div>
                </div>
            </div>

            <div class="right">
                <div class="form-group">
                    <label class="control-label col-xs-12 col-sm-2">{:__('服务费（合计）')}:</label>
                    <div class="col-xs-12 col-sm-10">
                        <input type="text" class="form-control" placeholder="请输入服务费（合计）" id="main_free"
                               oninput="vs()" onpropertychange="vs()" value="{$res.main_free}"
                               readonly="readonly">
                    </div>
                </div>
            </div>
        </div>
    </div>
    <div>
        <div class="tab-labels">
            <div class="xian"></div>
            特约及争议解决方式
        </div>
        <div class="form-group">
            <label class="control-label col-xs-12 col-sm-2" style="width: 110px;">{:__('争议解决方')}:</label>
            <div class="col-xs-12 col-sm-8" style="top: 7px;left: 0">
                <input type="radio" name="row[resolvent]" disabled
                       value="{$res.resolvent}"  <?= $res['resolvent'] == 1 ? ' checked="checked"' : '';?> /> 诉讼
                <input type="radio" name="row[resolvent]" disabled
                       value="{$res.resolvent}"  <?= $res['resolvent'] == 2 ? ' checked="checked"' : '';?>/>仲裁
            </div>
        </div>
        <div class="form-group">
            <label class="control-label col-xs-12 col-sm-2">{:__('特别约定')}:</label>
            <div class="col-xs-12 col-sm-10">
                        <textarea name="row[special]" rows="5" cols="10" id="txt" value="" readonly=""
                                  class="form-control" style="background: #fff;">{$res.special}</textarea>
            </div>
        </div>
    </div>
    <div>
        <div class="tab-labels">
            <div class="xian"></div>
            车主信息
        </div>
        <div class="hang">
            <div class="form-group">
                <label class="control-label col-xs-12 col-sm-2">{:__('姓名')}:</label>
                <div class="col-xs-12 col-sm-10">
                    <input id="c-car_owner" class="form-control" type="text" value="{$res.car_owner}" readonly>
                </div>
            </div>
            <div class="form-group">
                <label class="control-label col-xs-12 col-sm-2">{:__('证件类型')}:</label>
                <div class="col-xs-12 col-sm-10">
                    <select id="car_card_kind" disabled="disabled" class="form-control">
                        <option value="0"
                        <?php if($res['car_card_kind']=="0"){?> selected<?php }?>>身份证</option>
                        <option value="1"
                        <?php if($res['car_card_kind']=="1"){?> selected<?php }?>>统一社会信用代码</option>
                    </select>
                </div>
            </div>
            <div class="form-group">
                <label class="control-label col-xs-12 col-sm-2">{:__('证件号码')}:</label>
                <div class="col-xs-12 col-sm-10">
                    <input id="c-car_card" class="form-control" type="text" value="{$res.car_card}">
                </div>
            </div>
        </div>
    </div>
    <div>
        <div class="tab-labels">
            <div class="xian"></div>
            被服务人信息
        </div>
        <div class="hang">
            <div class="form-group">
                <label class="control-label col-xs-12 col-sm-2">{:__('姓名')}:</label>
                <div class="col-xs-12 col-sm-10">
                    <input id="c-learned_name" class="form-control" type="text" value="{$res.learned_name}"
                           readonly>
                </div>
            </div>
            <div class="form-group">
                <label class="control-label col-xs-12 col-sm-2">{:__('证件类型')}:</label>
                <div class="col-xs-12 col-sm-10">
                    <select id="learned_kind" disabled="disabled" class="form-control">
                        <option value="0"
                        <?php if($res['learned_kind']=="0"){?> selected<?php }?>>身份证</option>
                        <option value="1"
                        <?php if($res['learned_kind']=="1"){?> selected<?php }?>>统一社会信用代码</option>
                    </select>
                </div>
            </div>
            <div class="form-group">
                <label class="control-label col-xs-12 col-sm-2">{:__('证件号码')}:</label>
                <div class="col-xs-12 col-sm-10">
                    <input id="c-learned_num" class="form-control" type="text" value="{$res.learned_num}">
                </div>
            </div>
            <div class="form-group">
                <label class="control-label col-xs-12 col-sm-2">{:__('手机')}:</label>
                <div class="col-xs-12 col-sm-10">
                    <input id="c-learned_phone" class="form-control" type="text" value="{$res.learned_phone}">
                </div>
            </div>
        </div>
    </div>
</div>
<script src="/assets/js/ace1.4/assets/js/add.js" type="text/javascript"></script>

<script src="/assets/js/ace1.4/assets/js/jquery.min.js" type="text/javascript"></script>
<script>
    $('#tab1 input').attr('readonly', 'readonly');
    $('#tab4 input').attr('readonly', 'readonly');
    $('#tab4 select').attr('disabled', 'disabled');
    $(document).ready(function () {
        $('.tab-label').click(function () {
            // 移除所有标签的激活状态和内容的显示状态
            $('.tab-label, .tab').removeClass('active');
            // 添加激活状态到点击的标签和对应的内容
            $(this).addClass('active');
            $('#' + $(this).attr('for')).addClass('active');
        });
    });

    //处理金额
    function chuli_money() {
        var shigu_zeren = document.getElementById("c-shigu_zeren");
        var liucheng = document.getElementById("c-liucheng");
        var yufu = document.getElementById("c-yufu");
        if (shigu_zeren.value == "") {
            shigu_zeren.value = "0";
        } else if (shigu_zeren.value.length > 1) {
            shigu_zeren.value = shigu_zeren.value.replace(/^0+/, "")
        }
        if (liucheng.value == "") {
            liucheng.value = "0";
        } else if (liucheng.value.length > 1) {
            liucheng.value = liucheng.value.replace(/^0+/, "")
        }
        if (shigu_zeren.value != "" && liucheng.value != "") {
            var d = shigu_zeren.value * liucheng.value / 100;
            if (!isNaN(d)) {
                yufu.value = d.toFixed(2);
            }
        }
    }

    //录入保存
    function luru() {
        if (!handle_luru_from(1)) {
            return false;
        }

        var formData = $("#luru-form").serialize();
        console.log('formdata', formData)
        $.ajax({
            type: "POST",
            dataType: "json",
            url: "{:url('buchang/chakan/luruadd')}",
            data: formData,
            success: function (res) {
                if (res.code == 1) {
                    layer.alert(res.msg, {title: __('Warning'), icon: 1});
                } else {
                    layer.msg(res.msg, {title: __('Warning'), icon: 2});
                }

            },
            error: function () {
                layer.alert("error");
            }
        });
    }

    //处理必选
    function handle_luru_from() {
        try {
            testv('c-sj_car_ren', null, '实际驾驶员 不能为空');
            testv('c-car_card', null, '驾驶证号 不能为空');
            testv('c-car_zhunjia', null, '准驾车型 不能为空');
            testv('c-shigu_yuanyin', null, '事故原因 不能为空');
            testv('c-shigu_zeren', null, '预估责任 不能为空');
            testv('c-liucheng', null, '事故整体预估金额 不能为空');
            testv('c-shigu_group', null, '事故处理部门 不能为空');
            testv('c-shigu_type', null, '事故类型 不能为空');
            testv('c-zhongda_anjian', null, '重大案件 不能为空');
            testv('c-anjian_type', null, '案件状态 不能为空');
            testv('c-sanze_shang', null, '三责伤 不能为空');
            testv('c-sanzhe_wang', null, '三者亡 不能为空');
            testv('c-benche_shang', null, '本车伤 不能为空');
            testv('c-benche_wang', null, '本车亡 不能为空');
            testv('c-is_shijiu', null, '是否施救 不能为空');
            testv('c-is_daoshigu', null, '是否道路交通事故 不能为空');
            testv('c-shigubook', null, '交管事故书 不能为空');
            testv('c-daiwei', null, '代位求偿 不能为空');
            testv('c-xianchang', null, '第一现场 不能为空');
            testv('c-chakan_time', null, '查勘时间 不能为空');
            testv('c-chakan_add', null, '查勘地点 不能为空');
            return true;
        } catch (e) {
            return false;
        }
    }

    //必选
    function testv(id, reg, msg) {
        var dom = $('#' + id);
        var v = dom.val();
        console.log(id, v);
        if (v && (!reg || reg(v)))
            return true;
        layer.msg(msg);
        dom.focus();
        throw new Error(msg);
    }

    $("#ss").on("click", function () {
        var class_id = $('#class_id').val()
        if (!class_id) {
            layer.msg('请先选择分类在上传图片')
            $("#ss").show()
            return false
        } else {
            $("#ss").hide()
        }
    })

    //保存图片
    function save_files(target) {
        $(target).attr('disabled', true);
        var bid = document.getElementById('ids').value;
        var fd = {};
        var parent = $('#c-files').val();
        var class_id = $('#class_id').val();
        fd = JSON.stringify(fd);
        console.log('bid', bid)
        console.log('parent', parent)
        console.log('class_id', class_id)
    }

    //设置多个表格可编辑
    function EditTables() {
        for (var i = 0; i < arguments.length; i++) {
            SetTableCanEdit(arguments[i]);
        }
    }

    //设置表格是可编辑的
    function SetTableCanEdit(table) {
        for (var i = 1; i < table.rows.length; i++) {
            SetRowCanEdit(table.rows[i]);
        }
    }

    function SetRowCanEdit(row) {
        for (var j = 0; j < row.cells.length; j++) {
            //如果当前单元格指定了编辑类型，则表示允许编辑
            var editType = row.cells[j].getAttribute("EditType");
            if (!editType) {
                //如果当前单元格没有指定，则查看当前列是否指定
                editType = row.parentNode.rows[0].cells[j].getAttribute("EditType");
            }
            if (editType) {
                row.cells[j].onclick = function () {
                    EditCell(this);
                }
            }
        }
    }

    //设置指定单元格可编辑
    function EditCell(element, editType) {
        var editType = element.getAttribute("EditType");
        if (!editType) {
            //如果当前单元格没有指定，则查看当前列是否指定
            editType = element.parentNode.parentNode.rows[0].cells[element.cellIndex].getAttribute("EditType");
        }
        switch (editType) {
            case "TextBox":
                CreateTextBox(element, element.innerHTML);
                break;
            case "DropDownList":
                CreateDropDownList(element);
                break;
            default:
                break;
        }
    }

    //为单元格创建可编辑输入框
    function CreateTextBox(element, value) {
        //检查编辑状态，如果已经是编辑状态，跳过
        var editState = element.getAttribute("EditState");
        if (editState != "true") {
            //创建文本框
            var textBox = document.createElement("INPUT");
            textBox.type = "text";
            textBox.className = "EditCell_TextBox";
            //设置文本框当前值
            if (!value) {
                value = element.getAttribute("Value");
            }
            textBox.value = value;
            //设置文本框的失去焦点事件
            textBox.onblur = function () {
                CancelEditCell(this.parentNode, this.value);
            }
            //向当前单元格添加文本框
            ClearChild(element);
            element.appendChild(textBox);
            textBox.focus();
            textBox.select();
            //改变状态变量
            element.setAttribute("EditState", "true");
            element.parentNode.parentNode.setAttribute("CurrentRow", element.parentNode.rowIndex);
        }
    }

    //为单元格创建选择框
    function CreateDropDownList(element, value) {
        //检查编辑状态，如果已经是编辑状态，跳过
        var editState = element.getAttribute("EditState");
        if (editState != "true") {
            //创建下接框
            var downList = document.createElement("Select");
            downList.className = "EditCell_DropDownList";
            //添加列表项
            var items = element.getAttribute("DataItems");
            if (!items) {
                items = element.parentNode.parentNode.rows[0].cells[element.cellIndex].getAttribute("DataItems");
            }
            if (items) {
                items = eval("[" + items + "]");
                for (var i = 0; i < items.length; i++) {
                    var oOption = document.createElement("OPTION");
                    oOption.text = items[i].text;
                    oOption.value = items[i].value;
                    downList.options.add(oOption);
                }
            }
            //设置列表当前值
            if (!value) {
                value = element.getAttribute("Value");
            }
            downList.value = value;
            //设置创建下接框的失去焦点事件
            downList.onblur = function () {
                CancelEditCell(this.parentNode, this.value, this.options[this.selectedIndex].text);
            }
            //向当前单元格添加创建下接框
            ClearChild(element);
            element.appendChild(downList);
            downList.focus();
            //记录状态的改变
            element.setAttribute("EditState", "true");
            element.parentNode.parentNode.setAttribute("LastEditRow", element.parentNode.rowIndex);
        }
    }

    //取消单元格编辑状态
    function CancelEditCell(element, value, text) {
        element.setAttribute("Value", value);
        if (text) {
            element.innerHTML = text;
        } else {
            element.innerHTML = value;
        }
        element.setAttribute("EditState", "false");
        //检查是否有公式计算
        CheckExpression(element.parentNode);
    }

    //清空指定对象的所有字节点
    function ClearChild(element) {
        element.innerHTML = "";
    }

    //添加行
    function AddRow(table, index) {
        var lastRow = table.rows[table.rows.length - 1];
        var num = lastRow.cells.length;
        var newRow = lastRow.cloneNode(true);
        newRow.cells[0].firstChild.value = '';
        newRow.cells[1].firstChild.value = parseInt(newRow.cells[1].firstChild.value) + 1;
        for (var i = 2; i < num; i++) {
            if (i != 2 && i != 4 && i != 8) {
                newRow.cells[i].firstChild.value = '';
            }
        }
        table.tBodies[0].appendChild(newRow);
        SetRowCanEdit(newRow);
        return newRow;
    }

    //人伤添加行
    function AddRows(table, index) {
        var lastRow = table.rows[table.rows.length - 1];
        var num = lastRow.cells.length;
        var newRow = lastRow.cloneNode(true);
        for (var i = 0; i < num; i++) {
            if (i == 1) {
                newRow.cells[i].firstChild.value = parseInt(newRow.cells[i].firstChild.value) + 1;
            }
            if (i != 1) {
                newRow.cells[i].firstChild.value = '';
            }
        }
        table.tBodies[0].appendChild(newRow);
        SetRowCanEdit(newRow);
        return newRow;
    }

    //补偿款信息添加行
    function AddRow31(table, index) {
        const newRow = createNewRow();
        table.tBodies[0].appendChild(newRow); // 添加到表格
    }
    // 直接返回由 aaa 生成的 DOM 元素，而不是克隆的行
    function createNewRow() {
        const aaa = `
        <tr>
            <td><input type="checkbox" style="width: 15px;height: 15px;display: block;" name="id" class="shoukuanid" value=""></td>
            <td><input type="text" name="shoukuan_ren" class="shoukuan_ren"></td>
            <td><input type="text" name="shoukuan_kind" class="shoukuan_kind" list="shoukuan_kind">
                <datalist id="shoukuan_kind">
                    <option value="身份证">身份证</option>
                    <option value="统一社会信用代码">统一社会信用代码</option>
                </datalist>
            </td>
            <td><input type="text" name="shoukuan_card" class="shoukuan_card"></td>
            <td><input type="text" name="shoukuan_phone" class="shoukuan_phone"></td>
            <td><input type="text" name="shoukuan_relation" class="shoukuan_relation"></td>
            <td><input type="text" name="shoukuan_bank" class="shoukuan_bank"></td>
            <td><input type="text" name="shoukuan_account" class="shoukuan_account"></td>
            <td><input type="text" name="shoukuan_money" class="shoukuan_money"></td>
        </tr>
    `;

        // 将 HTML 字符串转换为 DOM 元素
        const template = document.createElement('template');
        template.innerHTML = aaa.trim(); // trim() 去除前后空格
        const newRow = template.content.firstChild;

        return newRow;
    }

    //删除行
    function DeleteRow(table, index) {
        console.log(table)
        for (var i = table.rows.length - 1; i > 1; i--) {
            var chkOrder = table.rows[i].cells[0].firstChild;
            if (chkOrder) {
                if (chkOrder.type = "CHECKBOX") {
                    if (chkOrder.checked) {
                        //执行删除
                        table.deleteRow(i);
                    }
                }
            }
        }
    }

    //提取表格的值,JSON格式
    function GetTableData(table) {
        var tableData = new Array();
        alert("行数：" + table.rows.length);
        for (var i = 1; i < table.rows.length; i++) {
            tableData.push(GetRowData(tabProduct.rows[i]));
        }
        return tableData;
    }

    //提取指定行的数据，JSON格式
    function GetRowData(row) {
        var rowData = {};
        for (var j = 0; j < row.cells.length; j++) {
            name = row.parentNode.rows[0].cells[j].getAttribute("Name");
            if (name) {
                var value = row.cells[j].getAttribute("Value");
                if (!value) {
                    value = row.cells[j].innerHTML;
                }
                rowData[name] = value;
            }
        }
        //alert("ProductName:" + rowData.ProductName);
        //或者这样：alert("ProductName:" + rowData["ProductName"]);
        return rowData;
    }

    //检查当前数据行中需要运行的字段
    function CheckExpression(row) {
        for (var j = 0; j < row.cells.length; j++) {
            expn = row.parentNode.rows[0].cells[j].getAttribute("Expression");
            //如指定了公式则要求计算
            if (expn) {
                var result = Expression(row, expn);
                var format = row.parentNode.rows[0].cells[j].getAttribute("Format");
                if (format) {
                    //如指定了格式，进行字值格式化
                    row.cells[j].innerHTML = formatNumber(Expression(row, expn), format);
                } else {
                    row.cells[j].innerHTML = Expression(row, expn);
                }
            }
        }
    }

    //计算需要运算的字段
    function Expression(row, expn) {
        var rowData = GetRowData(row);
        //循环代值计算
        for (var j = 0; j < row.cells.length; j++) {
            name = row.parentNode.rows[0].cells[j].getAttribute("Name");
            if (name) {
                var reg = new RegExp(name, "i");
                expn = expn.replace(reg, rowData[name].replace(/\,/g, ""));
            }
        }
        return eval(expn);
    }

    /**
     * 格式化数字显示方式
     * 用法
     * formatNumber(12345.999,'#,##0.00');
     * formatNumber(12345.999,'#,##0.##');
     * formatNumber(123,'000000');
     * @param num
     * @param pattern
     */
    /* 以下是范例
     formatNumber('','')=0
     formatNumber(123456789012.129,null)=123456789012
     formatNumber(null,null)=0
     formatNumber(123456789012.129,'#,##0.00')=123,456,789,012.12
     formatNumber(123456789012.129,'#,##0.##')=123,456,789,012.12
     formatNumber(123456789012.129,'#0.00')=123,456,789,012.12
     formatNumber(123456789012.129,'#0.##')=123,456,789,012.12
     formatNumber(12.129,'0.00')=12.12
     formatNumber(12.129,'0.##')=12.12
     formatNumber(12,'00000')=00012
     formatNumber(12,'#.##')=12
     formatNumber(12,'#.00')=12.00
     formatNumber(0,'#.##')=0
     */
    function formatNumber(num, pattern) {
        var strarr = num ? num.toString().split('.') : ['0'];
        var fmtarr = pattern ? pattern.split('.') : [''];
        var retstr = '';
        // 整数部分
        var str = strarr[0];
        var fmt = fmtarr[0];
        var i = str.length - 1;
        var comma = false;
        for (var f = fmt.length - 1; f >= 0; f--) {
            switch (fmt.substr(f, 1)) {
                case '#':
                    if (i >= 0) retstr = str.substr(i--, 1) + retstr;
                    break;
                case '0':
                    if (i >= 0) retstr = str.substr(i--, 1) + retstr;
                    else retstr = '0' + retstr;
                    break;
                case ',':
                    comma = true;
                    retstr = ',' + retstr;
                    break;
            }
        }
        if (i >= 0) {
            if (comma) {
                var l = str.length;
                for (; i >= 0; i--) {
                    retstr = str.substr(i, 1) + retstr;
                    if (i > 0 && ((l - i) % 3) == 0) retstr = ',' + retstr;
                }
            } else retstr = str.substr(0, i + 1) + retstr;
        }
        retstr = retstr + '.';
        // 处理小数部分
        str = strarr.length > 1 ? strarr[1] : '';
        fmt = fmtarr.length > 1 ? fmtarr[1] : '';
        i = 0;
        for (var f = 0; f < fmt.length; f++) {
            switch (fmt.substr(f, 1)) {
                case '#':
                    if (i < str.length) retstr += str.substr(i++, 1);
                    break;
                case '0':
                    if (i < str.length) retstr += str.substr(i++, 1);
                    else retstr += '0';
                    break;
            }
        }
        return retstr.replace(/^,+/, '').replace(/\.$/, '');
    }

    var tabProduct = document.getElementById("tabProduct");

    // 设置表格可编辑
    // 可一次设置多个，例如：EditTables(tb1,tb2,tb2,......)
    //EditTables(tabProduct);

</script>

   